home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
e-lang
/
dirlist.lha
/
dirlist
/
examples
/
DirList_Example3.e
< prev
Wrap
Text File
|
1996-05-02
|
984b
|
52 lines
/*
** DirList_Example 3
**
** Methods: setdir(), read(), sort(), first(), obj()
** succ(), dirname(), tagset()
**
**
** This code is placed in Public Domain
**
** (C)Copyright 1996 Fabio Rotondo
**
*/
MODULE 'Fabio/DirList_oo', -> Our MAGIC MODULE!
'tools/exceptions'
PROC main() HANDLE
DEF dl:PTR TO dirlist
NEW dl.dirlist()
dl.tagset([TAGDIR_COMPLETEPATH, TRUE, -> We want TO store the complete path
TAGDIR_MARKDIR, TRUE, -> AND we want DirList TO mark dirs
0,0
])
dl.setdir('ram:') -> We'll scan RAM:
WriteF('Reading...\n')
dl.read(TRUE, TRUE) -> Here we read it
WriteF('Sorting!\n')
dl.sort(TRUE) -> AND here we sort it
WriteF('Done!\n')
IF dl.first() -> Let's show!
REPEAT
WriteF('\s\n',dl.obj())
UNTIL dl.succ()=FALSE
ENDIF
WriteF('DIR:\s\n', dl.dirname()) -> Actual dir name is this
EXCEPT DO
report_exception()
END dl
ENDPROC